package com.skyline.spot.service;

import java.util.List;

import com.skyline.base.type.SpotRefrenceType;
import com.skyline.common.bean.Page;
import com.skyline.spot.model.SpotRefrence;

public interface SpotRefrenceService {

	/**
	 * search
	 * @param spotId
	 * @return
	 */
	/**
	 * 插入refrence
	 * @param refrenceId
	 * @param refrencePortrait type为Album是为相册封面，为Photo即为相片本身，其他有封面的为封面，不然就为空
	 * @param refrenceTitle refrence标题
	 * @param refrenceDigest 
	 * @param refrenceType ALBUM，PHOTO，ARTILE，TRAVLENOTE...
	 * @param spotId
	 * @param spotName
	 * @param spotPortrait
	 * @param providerId
	 * @param providerNickname
	 * @param providerPortrait
	 * @param providerEmail
	 * @return
	 */
	public Long postToSpot(Long refrenceId,String refrencePortrait, String refrenceTitle,
			String refrenceDigest, SpotRefrenceType refrenceType, Long spotId,
			String spotName,String spotPortrait,Long providerId, String providerNickname,
			String providerPortrait, String providerEmail);
	/**
	 * 根据Id返回一个特定的ref，在浏览类型是相册的时候用
	 * @param id
	 * @return
	 */
	public SpotRefrence getRefrenceById(Long id);
	
	/**
	 *获取spot的所有refrence
	 * @param spotId
	 * @param page
	 * @return
	 */
	public List<SpotRefrence> getRefrencesBySpotId(Long spotId,Page page);

	/**
	 * 根据Type获取，针对用户上传的photo需调用type为photo，返回图片
	 * @param spotId
	 * @param type
	 * @param page
	 * @return
	 */
	public List<SpotRefrence> getRefrencesBySpotIdAndType(Long spotId,
			SpotRefrenceType type,Page page);

	public List<SpotRefrence> getRefrenceByRefrenceIdAndSpotId(
			Long refrenceId, Long spotId,Page page);

	public List<SpotRefrence> getRefrenceByRefrenceType(SpotRefrenceType type,Page page);// 用户搜索时用

	public List<SpotRefrence> getRefrenceBySpotNameAndType(String spotName,
			SpotRefrenceType type,Page page);// 用户搜索时用


	

	public void recoverRefrenceFromSpot(Long refrenceId,Long spotId);
	
	public void recoverRefrenceFromSpotByProviderId(Long providerId,Long spotId);
	
	public void recoverRefrenceFromSpotByProviderIdAndType(Long providerId,SpotRefrenceType type ,Long spotId);
	
	
}
